package com.health.healthapplet.service.impl;

import com.github.pagehelper.PageHelper;
import com.health.healthapplet.entity.User;
import com.health.healthapplet.mapper.UserMapper;
import com.health.healthapplet.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;
    public int addUserInfo(String username, String password){
        User user = new User(username, password);
        user.setCreatetime(new Date());
        int count = userMapper.addUserInfo(user);
        return count;
    }
    public List<User> queryByUsername(String username){
        List<User> userList = userMapper.queryByUsername(username);
        return userList;
    }
    public List<User> queryList(){
        List<User> userList = userMapper.queryList();
        return userList;
    }

}
